package com.only4play.system.web.workorder;

import com.only4play.common.model.JsonObject;
import com.only4play.productcenter.api.product.service.ProductFeignService;
import com.only4play.productcenter.api.template.request.TemplateCreateRequest;
import com.only4play.system.mapper.ProductMapper;
import com.only4play.system.req.ProductCreateReq;
import com.only4play.system.req.WorkOrderCreateReq;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author hinzzz www.hinzzz.cn 157957329@qq.com
 * 2024-02-28
 */
@RestController
@RequestMapping(value = "workOrder")
@Schema(title = "工单管理")
@RequiredArgsConstructor
public class WorkOrderController {

    private final ProductFeignService productFeignService;


    /**
     * 创建工单
     * @param WorkOrderCreateReq
     * @return
     */
    @PostMapping(value = "createWorkOrder")
    public JsonObject<String> createWorkOrder(@RequestBody WorkOrderCreateReq req){

        //创建模板

        TemplateCreateRequest templateCreateRequest = ProductMapper.INSTANCE.workOrderCreateReq2Template(req);

        //创建产品

        return null;
    }

}
